package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author du
 * date 2018/8/3 上午9:59
 */
public class ExamineResultsResult implements Parcelable {
    /**
     * results : [{"num":"1","user":631,"AnswerRight":606,"CorrectRate":96.04,"UserAnswer":"A","row":"错误","analysis":2984}]
     * page_info : {"num":20,"average":5,"achievement":6,"examine_title":"2016年第25届一年级数学大王邀请赛真题","examine_score":120,"examine_id":"103","when":"00:50:10"}
     * score_statistics : [{"group_name":"100分","score":34.48,"color":"#70DB93"}]
     */

    private PageInfoEntity page_info;//页面返回信息
    private List<ResultsEntity> results;//统计的结果
    private List<ScoreStatisticsEntity> score_statistics;//考试得分统计（饼图）

    public PageInfoEntity getPage_info() { return page_info;}

    public void setPage_info(PageInfoEntity page_info) { this.page_info = page_info;}

    public List<ResultsEntity> getResults() { return results;}

    public void setResults(List<ResultsEntity> results) { this.results = results;}

    public List<ScoreStatisticsEntity> getScore_statistics() { return score_statistics;}

    public void setScore_statistics(List<ScoreStatisticsEntity> score_statistics) { this.score_statistics = score_statistics;}

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.page_info, flags);
        dest.writeTypedList(this.results);
        dest.writeTypedList(this.score_statistics);
    }

    public ExamineResultsResult() {}

    protected ExamineResultsResult(Parcel in) {
        this.page_info = in.readParcelable(PageInfoEntity.class.getClassLoader());
        this.results = in.createTypedArrayList(ResultsEntity.CREATOR);
        this.score_statistics = in.createTypedArrayList(ScoreStatisticsEntity.CREATOR);
    }

    public static final Creator<ExamineResultsResult> CREATOR = new Creator<ExamineResultsResult>() {
        @Override
        public ExamineResultsResult createFromParcel(Parcel source) {return new ExamineResultsResult(source);}

        @Override
        public ExamineResultsResult[] newArray(int size) {return new ExamineResultsResult[size];}
    };

    public static class PageInfoEntity implements Parcelable {
        /**
         * num : 20
         * average : 5
         * achievement : 6
         * examine_title : 2016年第25届一年级数学大王邀请赛真题
         * examine_score : 120
         * examine_id : 103
         * when : 00:50:10
         */

        private String num;//题目总数
        private String average;//平均分
        private String achievement;//本次得分
        private String examine_title;//试卷标题
        private String examine_score;//试卷总分
        private String examine_id;//试卷id
        private String when;//试卷总分
        /**
         * total_score : 16
         * exlistid : 161
         */
        private String total_score;//本次得分
        private String exlistid;//

        public String getNum() { return num;}

        public void setNum(String num) { this.num = num;}

        public String getAverage() { return average;}

        public void setAverage(String average) { this.average = average;}

        public String getAchievement() { return achievement;}

        public void setAchievement(String achievement) { this.achievement = achievement;}

        public String getExamine_title() { return examine_title;}

        public void setExamine_title(String examine_title) { this.examine_title = examine_title;}

        public String getExamine_score() { return examine_score;}

        public void setExamine_score(String examine_score) { this.examine_score = examine_score;}

        public String getExamine_id() { return examine_id;}

        public void setExamine_id(String examine_id) { this.examine_id = examine_id;}

        public String getWhen() { return when;}

        public void setWhen(String when) { this.when = when;}

        public PageInfoEntity() {}

        public String getTotal_score() { return total_score;}

        public void setTotal_score(String total_score) { this.total_score = total_score;}

        public String getExlistid() { return exlistid;}

        public void setExlistid(String exlistid) { this.exlistid = exlistid;}

        @Override
        public int describeContents() { return 0; }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.num);
            dest.writeString(this.average);
            dest.writeString(this.achievement);
            dest.writeString(this.examine_title);
            dest.writeString(this.examine_score);
            dest.writeString(this.examine_id);
            dest.writeString(this.when);
            dest.writeString(this.total_score);
            dest.writeString(this.exlistid);
        }

        protected PageInfoEntity(Parcel in) {
            this.num = in.readString();
            this.average = in.readString();
            this.achievement = in.readString();
            this.examine_title = in.readString();
            this.examine_score = in.readString();
            this.examine_id = in.readString();
            this.when = in.readString();
            this.total_score = in.readString();
            this.exlistid = in.readString();
        }

        public static final Creator<PageInfoEntity> CREATOR = new Creator<PageInfoEntity>() {
            @Override
            public PageInfoEntity createFromParcel(Parcel source) {return new PageInfoEntity(source);}

            @Override
            public PageInfoEntity[] newArray(int size) {return new PageInfoEntity[size];}
        };
    }

}
